<?php
require_once('MainModel.php');

/**
 * Add your description here
 *
 * @author Anh euro
 * @copyright Hipt Group
 * @license http://framework.zend.com/license/new-bsd     New BSD License
 */
 
class Vina_Model_Contacts extends MainModel
{

    /**
     * mysql var type int(11)
     *
     * @var int     
     */
    protected $_Id;
    
    /**
     * mysql var type varchar(100)
     *
     * @var string     
     */
    protected $_Name;
    
    /**
     * mysql var type varchar(100)
     *
     * @var string     
     */
    protected $_Email;
    
    /**
     * mysql var type varchar(150)
     *
     * @var string     
     */
    protected $_Address;
    
    /**
     * mysql var type varchar(30)
     *
     * @var string     
     */
    protected $_Mobile;
    
    /**
     * mysql var type varchar(30)
     *
     * @var string     
     */
    protected $_Fax;
    
    /**
     * mysql var type varchar(150)
     *
     * @var string     
     */
    protected $_Title;
    
    /**
     * mysql var type varchar(255)
     *
     * @var string     
     */
    protected $_Content;
    
    /**
     * mysql var type varchar(20)
     *
     * @var string     
     */
    protected $_OrderKey;
    
    /**
     * mysql var type timestamp
     *
     * @var string     
     */
    protected $_Created;
    

    

function __construct() {
    $this->setColumnsList(array(
    'id'=>'Id',
    'name'=>'Name',
    'email'=>'Email',
    'address'=>'Address',
    'mobile'=>'Mobile',
    'fax'=>'Fax',
    'title'=>'Title',
    'content'=>'Content',
    'order_key'=>'OrderKey',
    'created'=>'Created',
    ));
}

	
    
    /**
     * sets column id type int(11)     
     *
     * @param int $data
     * @return Vina_Model_Contacts     
     *
     **/

    public function setId($data)
    {
        $this->_Id=$data;
        return $this;
    }

    /**
     * gets column id type int(11)
     * @return int     
     */
     
    public function getId()
    {
        return $this->_Id;
    }
    
    /**
     * sets column name type varchar(100)     
     *
     * @param string $data
     * @return Vina_Model_Contacts     
     *
     **/

    public function setName($data)
    {
        $this->_Name=$data;
        return $this;
    }

    /**
     * gets column name type varchar(100)
     * @return string     
     */
     
    public function getName()
    {
        return $this->_Name;
    }
    
    /**
     * sets column email type varchar(100)     
     *
     * @param string $data
     * @return Vina_Model_Contacts     
     *
     **/

    public function setEmail($data)
    {
        $this->_Email=$data;
        return $this;
    }

    /**
     * gets column email type varchar(100)
     * @return string     
     */
     
    public function getEmail()
    {
        return $this->_Email;
    }
    
    /**
     * sets column address type varchar(150)     
     *
     * @param string $data
     * @return Vina_Model_Contacts     
     *
     **/

    public function setAddress($data)
    {
        $this->_Address=$data;
        return $this;
    }

    /**
     * gets column address type varchar(150)
     * @return string     
     */
     
    public function getAddress()
    {
        return $this->_Address;
    }
    
    /**
     * sets column mobile type varchar(30)     
     *
     * @param string $data
     * @return Vina_Model_Contacts     
     *
     **/

    public function setMobile($data)
    {
        $this->_Mobile=$data;
        return $this;
    }

    /**
     * gets column mobile type varchar(30)
     * @return string     
     */
     
    public function getMobile()
    {
        return $this->_Mobile;
    }
    
    /**
     * sets column fax type varchar(30)     
     *
     * @param string $data
     * @return Vina_Model_Contacts     
     *
     **/

    public function setFax($data)
    {
        $this->_Fax=$data;
        return $this;
    }

    /**
     * gets column fax type varchar(30)
     * @return string     
     */
     
    public function getFax()
    {
        return $this->_Fax;
    }
    
    /**
     * sets column title type varchar(150)     
     *
     * @param string $data
     * @return Vina_Model_Contacts     
     *
     **/

    public function setTitle($data)
    {
        $this->_Title=$data;
        return $this;
    }

    /**
     * gets column title type varchar(150)
     * @return string     
     */
     
    public function getTitle()
    {
        return $this->_Title;
    }
    
    /**
     * sets column content type varchar(255)     
     *
     * @param string $data
     * @return Vina_Model_Contacts     
     *
     **/

    public function setContent($data)
    {
        $this->_Content=$data;
        return $this;
    }

    /**
     * gets column content type varchar(255)
     * @return string     
     */
     
    public function getContent()
    {
        return $this->_Content;
    }
    
    /**
     * sets column order_key type varchar(20)     
     *
     * @param string $data
     * @return Vina_Model_Contacts     
     *
     **/

    public function setOrderKey($data)
    {
        $this->_OrderKey=$data;
        return $this;
    }

    /**
     * gets column order_key type varchar(20)
     * @return string     
     */
     
    public function getOrderKey()
    {
        return $this->_OrderKey;
    }
    
    /**
     * sets column created type timestamp     
     *
     * @param string $data
     * @return Vina_Model_Contacts     
     *
     **/

    public function setCreated($data)
    {
        $this->_Created=$data;
        return $this;
    }

    /**
     * gets column created type timestamp
     * @return string     
     */
     
    public function getCreated()
    {
        return $this->_Created;
    }
    
    /**
     * returns the mapper class
     *
     * @return Vina_Model_ContactsMapper
     *
     */

    public function getMapper()
    {
        if (null === $this->_mapper) {
            $this->setMapper(new Vina_Model_ContactsMapper());
        }
        return $this->_mapper;
    }


    /**
     * deletes current row by deleting a row that matches the primary key
     * 
     * @return int
     */

    public function deleteRowByPrimaryKey()
    {
        if (!$this->getId())
            throw new Exception('Primary Key does not contain a value');
        return $this->getMapper()->getDbTable()->delete('id = '.$this->getId());
    }

}

